#ifndef _VOL_H_
#define _VOL_H_

#include <type.h>

#define P_BOOT 0x80
#define P_VALID 0x0

#define getsect(ps) ((ps->bsecthcyl)&0x4f)
#define getcyl(ps) (ps->blcyl+((ps->bsecthcyl >> 6) << 8))

#define getesect(ps) ((ps->esecthcyl)&0x4f)
#define getecyl(ps) (ps->elcyl+((ps->esecthcyl >> 6) << 8))

#define POFF1 0x1be
#define POFF2 0x1ce
#define POFF3 0x1de
#define POFF4 0x1ee

#include <diskfmt.h>

#ifndef _DISK_VOLUME_STRUCT_
#define _DISK_VOLUME_STRUCT_

typedef struct {
	u32 start_lba;
	u32 len_lba;
	u32 current_cluster;
	char system[20];
	struct BPB_struct BPB;
	struct BPB_struct_FAT32 BPB_fat32;
	struct FSI_struct FSI;
}disk_volume;

#endif

int get_disk_volume(disk_volume *new_vol,int volno);
int init_vol();

#endif
